package cn.wizzer.app.user.modules.models;

import cn.wizzer.framework.base.model.BaseModel;
import lombok.Data;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;

import java.io.Serializable;
import java.util.Date;

/**
 * 直播
 */
@Data
@Table("live_broadcast")
@TableIndexes({@Index(name="unique_live_code",fields={"liveCode"},unique=false)})
public class LiveBroadcast extends BaseModel implements Serializable {

    public LiveBroadcast() {
    }

    public LiveBroadcast(String userId,String categoryId, String videoId, String streamUrl, String notice, boolean state, Date startTime) {
        this.userId = userId;
        this.categoryId = categoryId;
        this.videoId = videoId;
        this.streamUrl = streamUrl;
        this.notice = notice;
        this.state = state;
        this.startTime = startTime;
    }

    @Column
    @Name
    @Comment("ID")
    @ColDefine(type = ColType.VARCHAR, width = 32)
    @PrevInsert(uu32 = true)
    private String id;
    /**
     * 房号
     */
    private String roomNo;

    @Column
    @Comment("直播间号-用户使用")
    @ColDefine(type = ColType.VARCHAR, width = 8)
    private String liveCode;

    @Column
    @Comment("用户ID")
    @ColDefine(type = ColType.VARCHAR, width = 32)
    private String userId;

    @Column
    @Comment("赛程ID")
    @ColDefine(type = ColType.VARCHAR, width = 32)
    private String videoId;

    @Column
    @Comment("分类ID")
    @ColDefine(type = ColType.VARCHAR, width = 32)
    private String categoryId;

    @Column
    @Comment("直播流URL")
    @ColDefine(type = ColType.VARCHAR, width = 128)
    private String streamUrl;

    @Column
    @Comment("直播公告")
    @ColDefine(type = ColType.VARCHAR, width = 256)
    private String notice;

    /**
     * 状态 直播中 已结束
     */
    @Column
    @Comment("直播状态0已结束，1直播中")
    @ColDefine(type = ColType.BOOLEAN)
    private boolean state;

    /**
     * 日期+时间
     */
    @Column
    @Comment("开始时间")
    @ColDefine(type = ColType.DATETIME, width = 10)
    private Date startTime;  /**
     * 日期+时间
     */
    @Column
    @Comment("结束时间")
    @ColDefine(type = ColType.DATETIME, width = 10)
    private Date endTime;

}
